package top.smallway.bs_vr;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

import top.smallway.bs_vr.Arranges.Message;
import top.smallway.bs_vr.recycelviewAdapeter.MessageAdapeter;

public class Arrange extends AppCompatActivity {
    private Button arrange_by_speed;
    private RecyclerView log;
    private List<Message> message;
    private ImageView progressBar_Arrange;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_arrange);
        initview();
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
        log.setLayoutManager(linearLayoutManager);
        arrange_by_speed.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                progressBar_Arrange.setVisibility(View.VISIBLE);
                message = top.smallway.bs_vr.Arranges.Main.main("/storage/emulated/0/Android/data/com.StarRiverVR.LightBand/files/CustomMusic/");
                MessageAdapeter messageAdapeter=new MessageAdapeter((List<Message>) message,Arrange.this);
                log.setAdapter(messageAdapeter);
                progressBar_Arrange.setVisibility(View.GONE);

            }
        });
    }

    private void initview() {
        arrange_by_speed = findViewById(R.id.arrange_by_speed);
        log = findViewById(R.id.log);
        progressBar_Arrange=findViewById(R.id.progressBar_Arrange);
        progressBar_Arrange.setVisibility(View.GONE);
    }
}